package com.cn.common.core.exception;

import com.cn.common.core.serial.Serializer;

public class ErrorResponse extends Serializer {

    private int resultCode;
    private String reason;

    public ErrorResponse() {
    }

    public ErrorResponse(int resultCode, String reason) {
        this.resultCode = resultCode;
        this.reason = reason;
    }

    public int getResultCode() {
        return resultCode;
    }

    public void setResultCode(int resultCode) {
        this.resultCode = resultCode;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    @Override
    protected void read() {
        this.resultCode = readInt();
        this.reason = readString();
    }

    @Override
    protected void write() {
        writeInt(resultCode);
        writeString(reason);
    }
}
